import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
	{
		alias: ['/home'],
		path: '/',
		name: 'home',
		component: () => import('@/views/Home')
	},
	{
		path: '/article/:id',
		name: 'article',
		component: () => import('@/views/Article')
	},
	{
		path: '/search',
		name: 'search',
		component: () => import('@/views/Search')
	},
	{
		path: '/mine',
		name: 'mine',
		component: () => import('@/views/Mine')
	},
	// 个人信息   编辑资料
	{
		path: '/info',
		name: 'info',
		component: () => import('@/views/Mine/Info')
	},
	// 我的主页
	{
		path: '/mypage',
		name: 'mypage',
		component: () => import('@/views/Mine/MyPage')
	}
]

const router = new VueRouter({
	mode: 'history',
	base: process.env.BASE_URL,
	routes
})

export default router
